package com.boot.core.protocol

import com.alibaba.fastjson.JSON
import java.util.*

class ConnResponseForApp {

    var jsonrpc: String = "2.0"
    var id: String = ""
    var result: ConnectResultForApp? = null

    fun ConnResponseForApp(connectResultForApp: ConnectResultForApp): Any? {
        this.jsonrpc = this.jsonrpc
        this.id = this.id
        this.result = connectResultForApp
        return this
    }
    fun ConnResponseForApp(connectResponseForApp: ConnResponseForApp): Any? {
        this.jsonrpc = connectResponseForApp.jsonrpc
        this.id = connectResponseForApp.id
        this.result = connectResponseForApp.result
        return this
    }

    fun ConnResponseForApp(data: ConnResponseForApp.ConnectResultForApp.Data, code: Int, msg: String): Any? {
        val sign: String = "singTag"
        this.result = ConnectResultForApp(data, code, msg, sign)
        return this
    }

    class ConnectResultForApp(data: Data?, code: Int, msg: String, sign: String) {
        var code: Int = code
        var msg: String = msg
        var data: Data? = data
        var sign: String = sign

        class Data(sessionId: String, appId: String?, timestamp: String?, nonce: String?) {
            var sessionId: String? = sessionId
            var appId: String? = appId
            var timestamp: String? = timestamp
            var nonce: String? = nonce
        }
    }


}